define(
			[
	        	'jquery',
	        	'bootstrap',
	        	'underscore', 
	        	'backbone', 
	        	'text!templates/common/topbar.html'
        	],
        	function($,_bootstrap, _, Backbone, topbarTemplate) {
				var TopbarView = Backbone.View.extend({
					el : $("body"),
					initialize : function() {
						this.render();
					},
					render : function() {
						var compileTemplate = _.template(topbarTemplate, this.model);
						this.$el.prepend(compileTemplate);
						$('#bs-css').attr('href','css/bootstrap-'+this.model.defaultTheme+'.css');
						$('#themes a[data-value="'+this.model.defaultTheme+'"]').find('i').addClass('icon-ok');
						return this;
					},
					events : {
						'click #themes a' : 'changeTheme'
					},
					changeTheme : function(e) {
						e.preventDefault();
						current_theme=$(e.target).attr('data-value');
						$('#bs-css').attr('href','css/bootstrap-'+current_theme+'.css');
						$('#themes i').removeClass('icon-ok');
						$(e.target).find('i').addClass('icon-ok');
					}
				});
				return TopbarView;
});